// import OSS from 'ali-oss'
// function createOssClientTemp () {
//     return new Promise((resolve) => {
//       let client = new OSS({
//         accessKeyId: 'xxx',
//         accessKeySecret: 'xxx',
//         bucket: 'xxx'
//       })
//       resolve(client)
//     })
// }

import {createOssClientTemp} from './oss'
// 下载视频
function ossDownloadFile (objectKey,name) {
     createOssClientTemp().then( client => {
      let url = client.signatureUrl(objectKey, {
        response: {
          'content-disposition': 'attachment; filename="' + name + '.' + 'mp4' + '"'
        },
        expires: 3600
      }) 
      window.location.href = url
    })
} 

export {
    ossDownloadFile
}